{% extends "park/base.html" %}

{% block css %}
{% endblock %}

{% block content %}
<script type="text/javascript">
    var primary_menu = "menu_1";
    var sub_menu = "menu_1_1";
</script>

    <div class="col-md-12">
        <div class="panel panel-primary">
            <div class="panel-heading">

                <div class="panel-title"><h3>园区企业管理 <span style="font-size:12px;color:red;font-weight:normal">企业总数：{{ count }}（个），进入园区企业总数{{ count }}（个）</span></h3>
                </div>
                <div class="panel-options">
                    <form role="form" action="/park/submitsearchfill/" method="post" enctype="" class="form-horizontal pull-left">
                        <div class="form-group">
                            <label class="control-label">批次：</label>
                            <div>
                                <select class="form-control" name="fill">
                                <option value="0">全部</option>
                                    {% for i in enterfill %}
                                    <option value="{{ i.fill_key }}">{{ i.fill_key }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="form-group filter-btn">
                            <button type="submit" class="btn btn-green">查询</button>
                        </div>

                    </form>
                    <a href="/park/filladd/"  class="bg"><button type="button" class="btn btn-green">添加填报批次</button></a>
                    <!-- <a href="#" data-rel="reload"><i class="entypo-arrows-ccw"></i></a> -->
                 </div>
            </div>
            <div class="panel-body with-table">
                <table class="table table-bordered table-responsive" >
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>企业名称</th>
                        <th>法定代表人</th>
                        <th>企业地址</th>
{#                        <th>是否审核</th>#}
                        <th>是否填报</th>
                        <th>填报日期</th>
                        <th>填报批次</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for companys in contacts %}
                        {% for company in companys.getFillByPark %}
                            <tr>
                            <td>{{ company.enterprise.id }}</td>
                            <td>{{ company.enterprise.getInformation.enterprise_name }}</td>
                            <td>{{ company.enterprise.getInformation.legal_representative }}</td>
                            <td>{{ company.enterprise.getInformation.register_add2 }}</td>
{#                            <td>已审核</td>#}
                            <td>{% ifequal company.status 'no_submit' %}
                                    未填报
                                {% endifequal %}
                                {% ifequal company.status 'no submit' %}
                                    未填报
                                {% endifequal %}
                                {% ifequal company.status 'finish' %}
                                    已填报
                                {% endifequal %}
                                {% ifequal company.status 'submit' %}
                                    填报中
                                {% endifequal %}
                            </td>
                            <td>{{ company.fill_time }}</td>
                            <td>{{ companys.fill_key }}</td>
                            <td>
                                {% ifequal company.status 'finish' %}
                                    <a href="/park/companyEditFill/{{ company.enterprise.id }}/{{ companys.fill_key }}/" class="btn btn-info">重新填报</a>
                                {% endifequal %}

{#                                <a href="/park/companyDelete/{{ company.id }}" class="btn btn-danger">删除</a>#}
                            </td>
                        </tr>
                            {% endfor %}
                    {% endfor %}
                    </tbody>
                </table>
                <div class="row">
                    <div class="col-xs-6 col-left">
                        <div class="dataTables_info" id="table-3_info"></div>
                    </div>
                    <div class="col-xs-6 col-right">
                        <div class="dataTables_paginate paging_bootstrap" style="text-align: right;margin-right: 10px">
                            <ul class="pagination pagination-sm" >
                                {% if contacts.has_previous %}
                                    <li><a href="?page={{ contacts.previous_page_number }}">上一页</a></li>
                                {% else %}
                                    <li class="disabled"> <span>上一页</span></li>
                                {% endif %}
                                {% for p in paginator.page_range %}
                                    {% ifequal p contacts.number %}
                                        <li class="active"> <span class="p">{{p}}</span></li>
                                    {% else%}
                                        <li> <a href="?page={{ p }}">{{p}}</a></li>
                                    {% endifequal %}
                                {% endfor %}
                                {% if contacts.has_next %}
                                    <li class="next">  <a href="?page={{ contacts.next_page_number }}">下一页</a></li>
                                {% else %}
                                    <li class="disabled"><span>下一页</span></li>
                                {% endif %}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
{% endblock %}
{% block js %}
<script src="/static/js/date-choose.js"></script>
<script language="javascript">
    function getNextElement (field) {
        var form = field.form;
        for (var e = 0; e < form.elements.length; e++)
            if (field == form.elements[e])
                break;

        return form.elements[++e % form.elements.length];
    }
    function tabOnEnter (field, evt) {
        var keyCode = document.layers ? evt.which : document.all ?
                evt.keyCode : evt.keyCode;
        if (field.value.length == 1){
            getNextElement(field).focus();
            return false;
        }
    }
</script>
{% endblock %}